spin_lock(&heap_lock);
/*
- * TMEM: When available memory is scarce, allow only mid-size allocations
- * to avoid worst of fragmentation issues. Others try TMEM pools then fail.
+ * TMEM: When available memory is scarce due to tmem absorbing it, allow
+ * only mid-size allocations to avoid worst of fragmentation issues.
+ * Others try tmem pools then fail. This is a workaround until all
+ * post-dom0-creation-multi-page allocations can be eliminated.
*/
if ( opt_tmem && ((order == 0) || (order >= 9)) &&
- (total_avail_pages <= midsize_alloc_zone_pages) )
+ (total_avail_pages <= midsize_alloc_zone_pages) &&
+ tmem_freeable_pages() )
goto try_tmem;
/*
return pfp;
}
+EXPORT unsigned long tmem_freeable_pages(void)
+{
+ return tmh_freeable_pages();
+}
+
/* called at hypervisor startup */
static int __init init_tmem(void)
{
extern void tmem_destroy(void *);
extern void *tmem_relinquish_pages(unsigned int, unsigned int);
+extern unsigned long tmem_freeable_pages(void);
extern int opt_tmem;
#endif /* __XEN_TMEM_H__ */